package com.cjh.mybatis08.scriping.xmltags;

import com.cjh.mybatis08.mapping.SqlSource;
import com.cjh.mybatis08.scriping.LanguageDriver;
import com.cjh.mybatis08.session.Configuration;
import org.dom4j.Element;

/**
 * @Descripton xml语言驱动器
 * @Author cjh
 * @Date 2023/6/12 14:44
 */
public class XMLLanguageDriver implements LanguageDriver {


    @Override
    public SqlSource createSqlSource(Configuration configuration, Element script, Class<?> parameterType) {
        // 用XML脚本构建器解析
        XMLScriptBuilder builder = new XMLScriptBuilder(configuration, script, parameterType);
        return builder.parseScriptNode();
    }
}
